package com.huaji.learn.ui.notifications;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;

import com.huaji.learn.R;
import com.huaji.learn.repository.NoteRepository;

/**
 * 统计Fragment
 */
public class NotificationsFragment extends Fragment {
    public View onCreateView(@NonNull LayoutInflater inflater,
                             ViewGroup container, Bundle savedInstanceState) {

        View root = inflater.inflate(R.layout.fragment_notifications, container, false);

        NoteRepository repository = new NoteRepository(getContext());

        TextView txtCount = root.findViewById(R.id.txtNoteCount);
        txtCount.setText(repository.queryNoteCount() + "");

        return root;
    }
}